package com.zjtaixue.usersite.mapper;

import com.zjtaixue.usersite.domain.Class;
import com.zjtaixue.usersite.query.ClassQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ClassMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Class record);

    Class selectByPrimaryKey(Integer id);

    Class selectByClassNameAndMajorId(@Param("className") String className,@Param("majorId") Integer majorId);

    List<Class> selectAll();

    int updateByPrimaryKey(Class record);

    int queryCount(ClassQueryObject qo);

    List<Class> query(ClassQueryObject qo);

    List<Class> listByMajorId(Integer majorId);

    List<Class> listByYear(Integer enrollmentYear);

    int countByMajorId(Integer majorId);

    List<Class> getByName(String name);

    int countByName(String name);

    List<Class> getByNameAndMajorId(@Param("name")String name,@Param("majorId")Integer majorId);

    int countOthersByNameAndMajorId(Class cla);

    int countOthersByName(Class cla);

    List<Integer> listAllYears();
}